const BASEURL = "http://localhost:8888/lm"

export const request = (config) => {
	uni.showLoading({
		title:"正在加载..."
	})
	return new Promise((resolve,reject)=>{
		uni.request({
			url:BASEURL + config.url,
			method:config.method || "GET",
			data:config.data || {},
			success: res => {
				uni.hideLoading()
				resolve(res)
			},
			fail: err => {
				uni.hideLoading()
				return uni.showToast({
					title:"请求接口失败失败"
				})
				reject(err)
			}
		})
	})
}